package com.juqimiao.raccoon.commodity.interception;

import com.juqimiao.linn.command.CommandInterceptorI;
import com.juqimiao.linn.context.BusinessPointContext;
import com.juqimiao.linn.context.ContextManager;
import com.juqimiao.linn.interception.PreInterceptor;
import com.juqimiao.linn.transfer.Command;
import com.juqimiao.raccoon.commodity.context.TenantContext;

@PreInterceptor
public class ContextManageIntercepter implements CommandInterceptorI {

    @Override
    public void preIntercept(Command command) {
        BusinessPointContext context = (BusinessPointContext) ContextManager.getContext(BusinessPointContext.class);
        command.setBusinessPoint(context.getCurrent());
    }
}
